<?php
class EmailQueue_data extends Data {
	private $alias = 'www-yueshihui-com';

	private $tb = 'email_queue';
	private $cols = array('id', 'type', 'to', 'subject', 'content', 'created_time');
	
	/**
	 * 添加邮件到队列
	 * @param unknown_type $cols
	 */
	public function put($cols) {
		if(!($db = $this->connect($this->alias))) return false;
		
		return $db->insert($this->tb, $cols);
	}
	/**
	 * 从邮件队列中取出一条数据
	 * @param unknown_type $params
	 */
	public function get($params = array()) {
		if(!($db = $this->connect($this->alias))) return false;
		
		return $db->one($this->tb, $this->cols, $params);
	}
	public function delete($params) {
		if(!($db = $this->connect($this->alias))) return false;
		
		return $db->delete($this->tb, $params);
	}
}